import { Pipe, PipeTransform } from '@angular/core';

/**
 * Generated class for the MonthlyIncomePipe pipe.
 *
 * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
 */
@Pipe({
  name: 'monthlyIncome',
})
export class MonthlyIncomePipe implements PipeTransform {
  /**
   * Takes a value and makes it lowercase.
   */
  transform(value, ...args) {
      if(value){
          if(value == 0){
              return '0';
          }
          try{
              if(typeof value !== 'number')value = Number(value);
              return '￥'+value.toFixed(0);
          }catch (e){
              return '-';
          }
      }
      return '-';
  }
}
